package com.huanxun.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.content.Context;
import android.widget.Toast;

import com.google.gson.Gson;
import com.lidroid.xutils.HttpUtils;

/**
 * 工具类
 *
 */
public final class SystemUtils {
	
	public static Gson gson = new Gson();
	public static HttpUtils httpUtils = new HttpUtils();
	
	public static void toast(Context context,String text){
		Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
		
	}
	
	public static String changeTimeFormat(long time){
		Date date = new Date(time);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String format = sdf.format(date);
		return format;
	}
	
	public static String formatSystemTime(){
		long currentTimeMillis = System.currentTimeMillis();
		String formatSystemTime = changeTimeFormat(currentTimeMillis);
		return formatSystemTime;
		
	}
}
